/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package lianxishilili.demo;

import java.io.BufferedReader;
import java.io.InputStreamReader;

/**
 *
 * @author Administrator
 */
public class GetOuputsDemo {
    public static void main(String[] args)throws Exception {
        InputStreamReader in2=new InputStreamReader(System.in);
        BufferedReader in3=new BufferedReader(in2);
        
        String items[]={"衣","食","住","行","交际","爱好","其他",};
        float outputs[]=new float[7];
        float sum=0;
        for(int i=0;i<7;i++){  
            System.out.print("请输入---"+items[i]+"---这项开支的数量：");
            outputs[i]=Float.parseFloat(in3.readLine());
            sum=sum+outputs[i];
            System.out.println();
        }
        System.out.println("当天开支如下：");
        for(int i=0;i<7;i++){ 
            System.out.println(items[i]+":"+outputs[i]);
        }
        System.out.println("当天各项开支总和："+sum);
     }
}
